Skip to content

fix(lib): bitwarden-load-secrets value options fail fast on missing/flag-like values (#6932) - #6933

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/6932-bw-load-args-guard
Nov 7, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/6932-bw-load-args-guard

Conversation

@dezren39

@dezren39 dezren39 commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Fixes #6932.

lib/bitwarden-load-secrets.sh read every value-taking option's value as an unguarded "$2" + shift 2. A trailing option (--item last) made shift 2 fail without advancing, so the parse loop spun forever — hanging the caller's shell when the script is sourced, its primary documented mode. A flag in the value position (--item --bws) was swallowed as the value, silently running against an item literally named --bws.

Fix: each of --item, --field, --secret, --project, --prefix, --format now requires a present, non-empty, non-flag-like value, failing fast via the script's existing die idiom (with a sourced-mode abort so die's return cannot fall through to the hanging shift).

Tests: 4 new regression cases in scripts/tests/test_bitwarden_load_secrets.py (trailing options under a hard timeout, flag-as-value, empty value, sourced trailing option). Suite 8/8 on this branch; the new tests fail/timeout on the pre-fix script (3 failures + 3 errors). Verified on the laptop against the real script with stub bw/bws (probe ~/git/fleet/probe-bw-load-args).


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@dezren39
dezren39 requested a review from a team as a code owner November 7, 2026 18:04
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 637f1395-2ce7-453f-8a83-1bdd646e94df
Commits

Reviewing files that changed from the base of the PR and between 4c3d00c and b4f1602.

Files selected for processing: 1

  • scripts/tests/test_bitwarden_load_secrets.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@dezren39
dezren39 merged commit def55ca into main Nov 7, 2026
1 of 3 checks passed
@dezren39
dezren39 deleted the creator-b/6932-bw-load-args-guard branch November 7, 2026 18:04
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T18:05:26.242145Z b4f1602 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bitwarden-load-secrets: value-taking options hang forever on a trailing flag and swallow a following flag as the value

1 participant